#pragma once
#include "precompiled.h"
#include "Common.h"
#include "ModelLoader.h"
#include "TextureLoader.h"
#include "AssetDefines.h"

class Model;

class AssetIOManager
{
public:
	AssetIOManager(void);
	~AssetIOManager(void);

	// Get model.
	void GetProcedural_Plane( Model& model );

	// Get world scene order.
	void Get_WorldSceneOrder( std::queue<WORLD_SCENERY_ORDER> &ref_wso_q );

	// Load model.
	void load_model_to_pool( const char* path, const char* key );
	void load_model_plane( const char* key );

	// Load dot world file.
	void load_dot_world( const char* path );

private:
	char* readFile(const char *filename);

	// Load descriptions.
	void load_dot_yea( const char* path );
	void load_dot_model( const char* path );
	void priv_load_dot_world( const char* path );

	// Evaluate descriptions to load other files.
	void evaluate_scenery_desc( SCENERY_DESC &sd );
	void evaluate_world();

	std::queue<SCENERY_DESC> tmp_scenery_desc;
	std::queue<DOT_MODEL_FILE> tmp_model_desc;
	std::queue<DOT_YEA_FILE> tmp_yea_desc;

	// Things the world manager needs to create in it's world.
	std::queue<WORLD_SCENERY_ORDER> world_scenery_orders;
};

